<?php
	session_start();
		//login part:
		if(isset($_POST['uslogin']) or isset($_POST['adlogin'])){
			$username = $_POST['uname'];
			$password = $_POST['pass'];
			$_SESSION['uname'] = $username;
			
			if(isset($_POST['uslogin'])){
				if($username == "user" && $password =="user"){
					$_SESSION['logined']="uy";
					header('Location:user.php');
				}
				else{
					$_SESSION['logined']="n";
					$_SESSION['state'] = "user_error";
					header('Location:extra_page.php');
				}
			}
			else if(isset($_POST['adlogin'])){
				if($username == "admin" && $password =="admin"){
					$_SESSION['logined']="ay";
					header('Location:admin.php');
				}
				else{
					$_SESSION['logined']="n";
					$_SESSION['state'] = "admin_error";
					header('Location:extra_page.php');
				}
			}
			else{
				$_SESSION['logined']="n";
				$_SESSION['state'] = "login_error";
				header('Location:extra_page.php');
			}
		}
		else if (isset($_POST['logout'])){
			$_SESSION['logined']="n";
			$_SESSION['state'] = "login_error";
			$_SESSION['uname'] = "";
			header('Location:index.php');
		}
		
		//register part:
		if(isset($_POST['reg_submit'])){
			header('Location:index.php');
		}
		
		//Booking part:
		if(isset($_POST['s_book'])){
			header('Location:index.php');
		}
		
		//Order part:
		if(isset($_POST['Aset']) || isset($_POST['Bset'])||isset($_POST['Cset'])){
			if(isset($_POST['Aset'])){
				echo "A set has been selected.";
				header('Location:index.php');
			}
			else if(isset($_POST['Bset'])){
				echo "B set has been selected.";
				header('Location:index.php');
			}
			else if(isset($_POST['Cset'])){
				echo "C set has been selected.";
				header('Location:index.php');
			}
		}
		
		
		
?>